package com.fxd.ribbonrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @auther fuxudong
 * @date 2021/5/1 - 12:12
 */
@Configuration
public class MyselfRule {

    //注意：ribbon负载均衡算法，不能写在componentscan包及其子包下面
    @Bean
    public IRule myrule(){
        //定义为随机
        return new RandomRule();
    }

    /*

     */

}
